smartbuck8 2.2.0
Loading...
Searching...
No Matches
smartbuck8.h File Reference

This file contains API for Smart Buck 8 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  smartbuck8_t
 Smart Buck 8 Click context object. More...
struct  smartbuck8_cfg_t
 Smart Buck 8 Click configuration object. More...

Macros

#define SMARTBUCK8_REG_VOUT   0x01
 Smart Buck 8 register map.
#define SMARTBUCK8_REG_CONTROL   0x03
#define SMARTBUCK8_REG_STATUS   0x05
#define SMARTBUCK8_CONTROL_RESET   0x80
 Smart Buck 8 CONTROL register setting.
#define SMARTBUCK8_CONTROL_EN_FPWM_ON_CHANGE   0x40
#define SMARTBUCK8_CONTROL_SOFT_EN   0x20
#define SMARTBUCK8_CONTROL_EN_FPWM   0x10
#define SMARTBUCK8_CONTROL_EN_OUT_DISCHARGE   0x08
#define SMARTBUCK8_CONTROL_EN_HICCUP   0x04
#define SMARTBUCK8_CONTROL_V_RAMP_SPEED_0_25US   0x00
#define SMARTBUCK8_CONTROL_V_RAMP_SPEED_0_5US   0x01
#define SMARTBUCK8_CONTROL_V_RAMP_SPEED_1US   0x02
#define SMARTBUCK8_CONTROL_V_RAMP_SPEED_5US   0x03
#define SMARTBUCK8_CONTROL_V_RAMP_SPEED_MASK   0x03
#define SMARTBUCK8_STATUS_THERMAL_WARNING   0x10
 Smart Buck 8 STATUS register setting.
#define SMARTBUCK8_STATUS_HICCUP   0x08
#define SMARTBUCK8_STATUS_UVLO   0x01
#define SMARTBUCK8_VOUT_MV_MIN   400
 Smart Buck 8 vout setting.
#define SMARTBUCK8_VOUT_MV_MAX   1675
#define SMARTBUCK8_VOUT_MV_STEP_5MV   5
#define SMARTBUCK8_DEVICE_ADDRESS   0x42
 Smart Buck 8 device address setting.
#define SMARTBUCK8_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  smartbuck8_return_value_t { SMARTBUCK8_OK = 0 , SMARTBUCK8_ERROR = -1 }
 Smart Buck 8 Click return value data. More...

Functions

void smartbuck8_cfg_setup (smartbuck8_cfg_t *cfg)
 Smart Buck 8 configuration object setup function.
err_t smartbuck8_init (smartbuck8_t *ctx, smartbuck8_cfg_t *cfg)
 Smart Buck 8 initialization function.
err_t smartbuck8_default_cfg (smartbuck8_t *ctx)
 Smart Buck 8 default configuration function.
err_t smartbuck8_write_reg (smartbuck8_t *ctx, uint8_t reg, uint8_t data_in)
 Smart Buck 8 write register function.
err_t smartbuck8_read_reg (smartbuck8_t *ctx, uint8_t reg, uint8_t *data_out)
 Smart Buck 8 read register function.
void smartbuck8_enable_power (smartbuck8_t *ctx)
 Smart Buck 8 enable power function.
void smartbuck8_disable_power (smartbuck8_t *ctx)
 Smart Buck 8 disable power function.
void smartbuck8_enable_device (smartbuck8_t *ctx)
 Smart Buck 8 enable device function.
void smartbuck8_disable_device (smartbuck8_t *ctx)
 Smart Buck 8 disable device function.
uint8_t smartbuck8_get_pg_pin (smartbuck8_t *ctx)
 Smart Buck 8 get power-good pin function.
err_t smartbuck8_read_status (smartbuck8_t *ctx, uint8_t *status)
 Smart Buck 8 read status register function.
err_t smartbuck8_set_control (smartbuck8_t *ctx, uint8_t control)
 Smart Buck 8 set control register function.
err_t smartbuck8_set_vout (smartbuck8_t *ctx, uint16_t vout_mv)
 Smart Buck 8 set output voltage function.

Detailed Description

This file contains API for Smart Buck 8 Click Driver.

Enumeration Type Documentation

◆ smartbuck8_return_value_t

Smart Buck 8 Click return value data.

Predefined enum values for driver return values.

Enumerator
SMARTBUCK8_OK 
SMARTBUCK8_ERROR